package com.wwl.cms.utils.JVMTest;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/5/21 23:01
 * @description:
 */
public class ClassLoaderTest {
    public static void main(String[] args) {
        //获取系统类加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);

        //获取其上层;扩展类加载器
        ClassLoader extClassLoader = systemClassLoader.getParent();
        System.out.println(extClassLoader);

        //获取其上层
        ClassLoader bootstrapClassLoader = extClassLoader.getParent();
        System.out.println(bootstrapClassLoader);

        ClassLoader testClassLoader =ClassLoaderTest.class.getClassLoader();
        System.out.println(testClassLoader);

       ClassLoader stringClassLoader = String.class.getClassLoader();
       System.out.println(stringClassLoader);
    }
}
